482196126 by Unknown

482196126 by Unknown

Author:Unknown
Language: eng
Format: epub


Electric Diagram

Components:

 Raspberry Pi Zero W

 DHT11 Sensor Humidity Sensor

 BMP085 Barometric Pressure Sensor

 Resisitor 4k7

4.3 Software

The project was made with Python version 2.7.13 and the source code is as follows.

I also add comments that explain what the code is doing.

//******************************

# Script will be used to read sensor data and then post the IoT Thinkspeak

# Read Temperature & Humidity using DHT11 sensor attached to Raspberry PI Zero W

# Read Pressure and Altitude using BMP085 sensor attached to Raspberry PI Zero W

# Program posts these values to a thingspeak channel

# Import all the libraries we need to run

import sys

import RPi.GPIO as GPIO

import os

from time import sleep

import Adafruit_DHT

import urllib2

import Adafruit_BMP.BMP085 as BMP085

DEBUG = 1

# Define GPIO pin to which DHT11 is connected

DHTpin = 4

#Setup our API and delay

myAPI = " GET_YOUR_KEY" # API Key from thingSpeak.com channel myDelay = 15 #how many seconds between posting data

GPIO.setmode(GPIO.BCM)



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.